package com.iseastar.guojiang.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class DataSharedPreferences {

	static DataSharedPreferences mSPreferences;

	private final static String ORDER = "order";

	public static synchronized DataSharedPreferences getInstance() {
		if (mSPreferences == null) {
			mSPreferences = new DataSharedPreferences();
		}
		return mSPreferences;
	}

	public void setOrderIdStatus(Context context, String orderId, boolean isKnow) {
		SharedPreferences mSharedPreferences = context.getSharedPreferences(ORDER, Context.MODE_PRIVATE);
		Editor editor = mSharedPreferences.edit();
		editor.putBoolean(orderId, isKnow);
		editor.commit();
	}

	public boolean getOrderIdStatus(Context context, String orderId) {
		SharedPreferences mSharedPreferences = context.getSharedPreferences(ORDER, Context.MODE_PRIVATE);
		boolean cid = mSharedPreferences.getBoolean(orderId, false);
		return cid;
	}
}
